local MonsterSpawner = class("MonsterSpawner")
local GameUtils = require("utils.GameUtils")

function MonsterSpawner:ctor()
end

function MonsterSpawner:awake()
    self._totaldt = 0
    self._spawnCount = 0
end

function MonsterSpawner:start()
end

function MonsterSpawner:update()
    -- if self._spawnCount >= self.spawnLimit then
    --     return
    -- end
    -- self._totaldt = self._totaldt + G_Time.deltaTime
    -- if self._totaldt >= self.spawnTime then
    --     local gameObject, monster = GameUtils.instantiate(self.srcPrefab.gameObject)
    --     local startPos = self.transform.position
    --     local startX = math.random(1, self.spawnRadius)
    --     local symbolX = math.random(1, 2)
    --     if symbolX == 2 then
    --         startX = -startX
    --     end
    --     local startZ = math.random(1, self.spawnRadius)
    --     local symbolZ = math.random(1, 2)
    --     if symbolZ == 2 then
    --         startZ = -startZ
    --     end
    --     startPos.x = startPos.x + startX
    --     startPos.z = startPos.z + startZ
    --     gameObject.transform.position = startPos
    --     monster:setSpawner(self)
    --     self._spawnCount = self._spawnCount + 1
    --     self._totaldt = 0
    -- end
end

function MonsterSpawner:recycle()
    self._spawnCount = self._spawnCount - 1
end

function MonsterSpawner:onDestroy()
end

return MonsterSpawner
